// 2025/11/19
// Pow(x, n)

class Solution {
    double quickMul(double x, long long n)
    {
        double ans = 1.0, cur = x;
        while(n > 0 && ans != 0)
        {
            if(n & 1) 
                ans *= cur;
            cur *= cur;
            n >>= 1;
        }
        return ans;
    }
public:
    double myPow(double x, int n) {
        long long N = n;
        return N >= 0 ? quickMul(x, N) : quickMul(1.0 / x, -N);
    }
};